home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 008 / cps.arc / CONTEXT.BAS < prev    next >
Encoding:
BASIC Source File  |  1986-02-06  |  1.3 KB  |  30 lines

  1. 1       'Written by Jeffrey D. Prouty, Jordan Oil & Gas Co., January 1986
  2. 3       ON ERROR GOTO 900
  3. 5       COLOR 9,0,0 : CLS
  4. 10      PRINT "**** CONTEXT ****" : PRINT : PRINT
  5. 20      PRINT "This program accepts an AutoCAD DXF file as input,
  6. 30      PRINT "extracts the X,Y endpoints of all lines on numbered
  7. 40      PRINT "layers, and writes them to an X,Y,Z DAT file of the
  8. 50      PRINT "same name with the layer names as Z values.  Thus,
  9. 60      PRINT "contours may be Sketched on separate layers and ex-
  10. 70      PRINT "tracted for input to a contouring program (3F14.x).
  11. 90      PRINT : PRINT
  12. 100     INPUT "Name of DXF file (extention of .DXF assummed)";F$
  13. 120     OPEN F$+".DXF" FOR INPUT AS #1
  14. 130     OPEN F$+".DAT" FOR OUTPUT AS #2
  15. 200     WHILE L$<>"ENTITIES" : LINE INPUT #1, L$ : WEND
  16. 300     WHILE L$<>"LINE" : LINE INPUT #1, L$ : WEND
  17. 400     INPUT #1, L$, Z1 : IF Z1=0 THEN 300
  18. 410     INPUT #1, L$, X1
  19. 420     INPUT #1, L$, Y1
  20. 425     IF X2<>0 THEN IF X1<>X2 AND Y1<>Y2 THEN PRINT #2, X2, Y2, Z2
  21. 427     PRINT #2, X1, Y1, Z1 : Z2=Z1
  22. 430     INPUT #1, L$, X2
  23. 440     INPUT #1, L$, Y2
  24. 590     GOTO 300
  25. 900     PRINT #2, X2, Y2, Z2
  26. 910     PRINT : PRINT "Contour data has been extracted to file:       ";F$;".DAT"
  27. 920     CLOSE 1, 2
  28. 998     SYSTEM
  29. 999     END
  30.